home *** CD-ROM | disk | FTP | other *** search
- Path: news.NetVision.net.il!news
- From: ggil@netvision.net.il
- Newsgroups: comp.lang.c
- Subject: Re: How to detect EOF?/filepointer problem.
- Date: Sun, 14 Apr 96 23:44:07 PDT
- Organization: NetVision LTD.
- Message-ID: <NEWTNews.829550737.4541.ggil@dialup.netvision.net.il>
- References: <316F8932.2BAF@www.partio.fi>
- NNTP-Posting-Host: ts008p14.pop9a.netvision.net.il
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
-
-
- In Article<316F8932.2BAF@www.partio.fi>, <ralph@www.partio.fi> writes:
- > Path:
- news.NetVision.net.il!psinntp!psinntp!psinntp!howland.reston.ans.net!newsfeed.i
- nternetmci.com!in2.uu.net!nntp.inet.fi!news.funet.fi!news.kolumbus.fi!usenet
- > From: "R.K.Brand" <ralph@www.partio.fi>
- > Newsgroups: comp.lang.c
- > Subject: How to detect EOF?/filepointer problem.
- > Date: Sat, 13 Apr 1996 04:00:02 -0700
- > Organization: Kolumbus Information Network, Finnet Group
- > Lines: 24
- > Message-ID: <316F8932.2BAF@www.partio.fi>
- > NNTP-Posting-Host: kasav6.kauniainen.fi
- > Mime-Version: 1.0
- > Content-Type: text/plain; charset=us-ascii
- > Content-Transfer-Encoding: 7bit
- > X-Mailer: Mozilla 2.0 (Win16; I)
- >
- > Sorry to bother you, but I have a problem
- > while scanning through a file too see whether
- > or not a certain word occurs.
- > When I run out of file, fscanf() keeps
- > returning the last line, instead of some NULL
- > value I would find logical (but who am I?).
- >
- > How can I test for the end of the file?
-
- If you use fgets() instead you may avoid many problems
- ( it returns NULL on EOF )
-
- Gil Gilad
- ggil@netvision.net.il
-
-
-